import redRequest from '@/service';
import { IResponseDataType } from '../../type';

// 获取各个页面需要展示的数据list,主要供page-content消费
export function requestPageListData(url: string, queryInfo: any = {}) {
  return redRequest.post<IResponseDataType>({
    url: url,
    data: queryInfo
  });
}

// 删除某个表格某条数据
export function deleteDataInPageList(url: string) {
  return redRequest.delete<IResponseDataType>({
    url: url
  });
}

// 添加数据
export function createDataInPageList(url: string, formInfo: any) {
  return redRequest.post<IResponseDataType>({
    url: url,
    data: formInfo
  });
}

// 编辑数据
export function editDataInPageList(url: string, formInfo: any) {
  return redRequest.patch<IResponseDataType>({
    url: url,
    data: formInfo
  });
}
